%x CODE
%x UNUSED
%%
(#){1,6}[\t ]+ "HeadStart"
<INITIAL>[\t ]*```[\t ]* <+CODE>"CodeStart"
<CODE>\\```|[^`\\]+|. "Code"
<CODE>[\t ]*```[\t ]*  <-CODE>"CodeEnd"

! "!"
\[ "["
\] "]"
\( "("
\) ")"
[\t ]+ "Blank"
[ ]{2,}\n|\<br(/)?\> "BR"
\n "Line"
\z  "EOF"
\*{1}  "Italic"
(\*){2}  "Bold"
(~){2}  "DeleteLine"
(_){2}  "Underscore"
[\t ]*((\d)+|[a-zA-Z])\.[\t ]+ "ListItem"
[\t ]*\*[\t ]+ "UN_ORDER_ASTERISK_LISTITEM"
[\t ]*\+[\t ]+ "UN_ORDER_PLUS_LISTITEM"
[\t ]*\-[\t ]+ "UN_ORDER_MINUS_LISTITEM"

[\t ]*\-[\t ]+\[[\t ]+\][\t ]+ "UNCHECK_LISTTIEM"
[\t ]*\-[\t ]+\[[\t ]*x[\t ]*\][\t ]+ "CHECK_LISTTIEM"

[\t ]*\|[\t ]* "|"
[\t ]*(-){2,}[\t ]* "TableHead"
[\t ]*:(-){2,}[\t ]* "TableHeadLeftAlign"
[\t ]*(-){2,}:[\t ]* "TableHeadRightAlign"
[\t ]*:(-){2,}:[\t ]* "TableHeadCenterAlign"

\\[^\ \t] "EC"
(#{7,})|. "C"
<UNUSED>u 'u'
<UNUSED>v 'v'
<UNUSED>u 'w'